---
feature_name: Rest parameters (ES2015)
chrome_version: 47
feature_id: 5937087912083456
---

<h3>Background</h3>
<p>
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters">Rest parameters</a> allow your functions to have variable number of arguments without using the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments">arguments</a> object. The rest parameter is an instance of Array so all the array methods just work.
</p>

<p>Note that there can only be a single rest parameter for a given function. This means that <code>listAnimals(...cats, ...dogs)</code> will not work, whilst <code>listAnimals(...cats)</code> will work just fine.</p>

{% include output_helper.html %}

{% include js_snippet.html filename='demo.js' %}
